package com.svms.service.vo;

import java.io.Serializable;
import java.util.Date;

/**
 * @author om39a
 * 
 */
public class VehicleSpareVO implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public String vehicleSpareId;
	public SpareCodesVO spareCodes;

	public VehicleVO vehicleVO;

	public String invoiceNumber;

	public Date installationDate;

	public String distanceTraveled;
	public String daysTraveled;

	public String vehicleSpareCost; // Should come under Bill info

	public ResultCodeVO resultCode;

	public String getVehicleSpareId() {
		return vehicleSpareId;
	}

	public void setVehicleSpareId(String vehicleSpareId) {
		this.vehicleSpareId = vehicleSpareId;
	}

	public String getInvoiceNumber() {
		return invoiceNumber;
	}

	public void setInvoiceNumber(String invoiceNumber) {
		this.invoiceNumber = invoiceNumber;
	}

	public String getSpareId() {
		return getSpareCodes().getSpareId();
	}

	public String getSpareName() {
		return getSpareCodes().getSpareName();
	}

	public VehicleVO getVehicleVO() {
		return vehicleVO;
	}

	public void setVehicleVO(VehicleVO vehicleVO) {
		this.vehicleVO = vehicleVO;
	}

	public Date getInstallationDate() {
		return installationDate;
	}

	public void setInstallationDate(Date installationDate) {
		this.installationDate = installationDate;
	}

	public String getDistanceTraveled() {
		return distanceTraveled;
	}

	public void setDistanceTraveled(String distanceTraveled) {
		this.distanceTraveled = distanceTraveled;
	}

	public String getDaysTraveled() {
		return daysTraveled;
	}

	public void setDaysTraveled(String daysTraveled) {
		this.daysTraveled = daysTraveled;
	}

	public SpareCodesVO getSpareCodes() {
		return spareCodes;
	}

	public void setSpareCodes(SpareCodesVO spareCodes) {
		this.spareCodes = spareCodes;
	}

	public ResultCodeVO getResultCode() {
		return resultCode;
	}

	public void setResultCode(ResultCodeVO resultCode) {
		this.resultCode = resultCode;
	}

	public String getVehicleSpareCost() {
		return vehicleSpareCost;
	}

	public void setVehicleSpareCost(String vehicleSpareCost) {
		this.vehicleSpareCost = vehicleSpareCost;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((daysTraveled == null) ? 0 : daysTraveled.hashCode());
		result = prime
				* result
				+ ((distanceTraveled == null) ? 0 : distanceTraveled.hashCode());
		result = prime
				* result
				+ ((installationDate == null) ? 0 : installationDate.hashCode());
		result = prime * result
				+ ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
		result = prime * result
				+ ((spareCodes == null) ? 0 : spareCodes.hashCode());
		result = prime
				* result
				+ ((vehicleSpareCost == null) ? 0 : vehicleSpareCost.hashCode());
		result = prime * result
				+ ((vehicleSpareId == null) ? 0 : vehicleSpareId.hashCode());
		result = prime * result
				+ ((vehicleVO == null) ? 0 : vehicleVO.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		VehicleSpareVO other = (VehicleSpareVO) obj;
		if (daysTraveled == null) {
			if (other.daysTraveled != null)
				return false;
		} else if (!daysTraveled.equals(other.daysTraveled))
			return false;
		if (distanceTraveled == null) {
			if (other.distanceTraveled != null)
				return false;
		} else if (!distanceTraveled.equals(other.distanceTraveled))
			return false;
		if (installationDate == null) {
			if (other.installationDate != null)
				return false;
		} else if (!installationDate.equals(other.installationDate))
			return false;
		if (invoiceNumber == null) {
			if (other.invoiceNumber != null)
				return false;
		} else if (!invoiceNumber.equals(other.invoiceNumber))
			return false;
		if (spareCodes == null) {
			if (other.spareCodes != null)
				return false;
		} else if (!spareCodes.equals(other.spareCodes))
			return false;
		if (vehicleSpareCost == null) {
			if (other.vehicleSpareCost != null)
				return false;
		} else if (!vehicleSpareCost.equals(other.vehicleSpareCost))
			return false;
		if (vehicleSpareId == null) {
			if (other.vehicleSpareId != null)
				return false;
		} else if (!vehicleSpareId.equals(other.vehicleSpareId))
			return false;
		if (vehicleVO == null) {
			if (other.vehicleVO != null)
				return false;
		} else if (!vehicleVO.equals(other.vehicleVO))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "VehicleSpareVO [vehicleSpareId=" + vehicleSpareId
				+ ", spareCodes=" + spareCodes + ", vehicleVO=" + vehicleVO
				+ ", invoiceNumber=" + invoiceNumber + ", installationDate="
				+ installationDate + ", distanceTraveled=" + distanceTraveled
				+ ", daysTraveled=" + daysTraveled + ", vehicleSpareCost="
				+ vehicleSpareCost + ", resultCode=" + resultCode + "]";
	}

}
